import { requestClient } from '#/api/request';

export function AddObj(obj: any) {
  return requestClient.request('/iam/tenant/database', {
    method: 'post',
    data: obj,
  });
}

export function DelObj(id: any) {
  return requestClient.request(`/iam/tenant/database/${id}`, {
    method: 'delete',
    data: { id },
  });
}

export function UpdateObj(obj: any) {
  return requestClient.request(`/iam/tenant/database/${obj.id}`, {
    method: 'put',
    data: obj,
  });
}

export function GetPage(query: any) {
  return requestClient.post(`/iam/tenant/database/page`, {
    page: { current: query.current, size: query.size },
    model: {
      name: query?.name,
      dbType: query?.dbType,
      locked: query?.locked,
    },
  });
}
